<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>用户管理</title>
    <link rel="stylesheet" type="text/css" href="/css/base.css">

</head>

<body>
<table border>
    <caption> 用户管理</caption>
    <thead>
    <th>用户号</th>
    <th>用户姓名</th>
    <th>用户年龄</th>
    <th>操作</th>
    </thead>
    <c:forEach items="${users}"  var="user">
        <tr>
            <td>${user.userno}</td>
            <td>${user.username}</td>
            <td>${user.userage}</td>
            <td><button onclick="del(${user.userno})">删除</button></td>
        </tr>
    </c:forEach>


</table>
<br/>
<button onclick="add()"> 新增用户</button>
<script>
    function  del(userId){
        location.replace(`/user/del?id=`+userId,)
    }
    function  add(){
        location.replace(`/userAdd.page`)
    }
</script>
</body>
</html>
